﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;

namespace KISS.Tests
{
    public class EncodingTests
    {
        [Test]
        public void ValidEncodingNameReturnsEncoding()
        {
            var encodingName = "UTF-7";
            var encoding = ArgumentHelper.GetEncoding(encodingName);
            Assert.AreEqual(Encoding.UTF7, encoding);
        }

        [Test]
        public void InValidEncodingNameReturnsDefaultEncoding()
        {
            var encodingName = "UTF-78";
            var encoding = ArgumentHelper.GetEncoding(encodingName);
            Assert.AreEqual(Encoding.Default, encoding);
        }

        [Test]
        public void NullEncodingNameReturnsDefaultEncoding()
        {
            string encodingName = null;
            var encoding = ArgumentHelper.GetEncoding(encodingName);
            Assert.AreEqual(Encoding.Default, encoding);
        }
    }
}
